<?php

namespace app\queue\redis;

use app\api\logic\GoodsSearchLogic;
use support\constants\QueueKey;
use Webman\RedisQueue\Consumer;

class GoodsSync implements Consumer
{
    // 要消费的队列名
    public $queue = QueueKey::GOODS_SYNC;

    // 连接名，对应 plugin/webman/redis-queue/redis.php 里的连接`
    public $connection = 'default';


    // 消费
    public function consume($data)
    {
        if (isset($data['ids']) && $data['ids']) {
            GoodsSearchLogic::sync($data['ids']);
        }
    }
}
